package deweb.cimaplanning.beans;

import java.util.ArrayList;
import com.cpi.cornpp.costelement.exception.CostElementException;
import deweb.cimaplanning.dao.CostsElementsDao;

public class CostsElementsBean {
	private CostsElementsDao dao = null;
	
	public CostsElementsBean(){
		dao = new CostsElementsDao();
	}
	
	public ArrayList browse(){
		return browse(1, true, "");
	}
	
	public ArrayList browse(int orderField, boolean ascendingOrder, String filters){
		ArrayList results = null;
		
		try {
			results = dao.getArray(orderField, ascendingOrder, filters);
		} catch (CostElementException e) {
			e.printStackTrace();
			return null;
		}
		
		return results;
	}
}
